//
//  CBVedioDetailView.m
//  CultureBreath
//
//  Created by lanou on 15/10/26.
//  Copyright © 2015年 lanou. All rights reserved.
//

#import "CBVedioDetailView.h"
#import "UIButton+WebCache.h"
@implementation CBVedioDetailView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _screenPicture = [[UIImageView alloc]initWithFrame:[[UIScreen mainScreen]bounds]];
        _screenPicture.userInteractionEnabled = YES;
        [self addSubview:_screenPicture];
        
        _pictureView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT/2)];
        _pictureView.userInteractionEnabled = YES;
        [self.screenPicture addSubview:_pictureView];
        
        _playButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _playButton.frame = CGRectMake(SCREEN_WIDTH/2-25, SCREEN_HEIGHT/4-25, 50, 50);
        [_playButton setImage:[UIImage imageNamed:@"pause"] forState:UIControlStateNormal];
        [_pictureView addSubview:_playButton];
        
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, SCREEN_HEIGHT/2+10, SCREEN_WIDTH-20, 30)];
        _titleLabel.textColor = [UIColor whiteColor];
        [self.screenPicture addSubview:_titleLabel];
        
        UIImageView *lineImageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, SCREEN_HEIGHT/2+46, SCREEN_WIDTH/2, 2)];
        lineImageView.image = [UIImage imageNamed:@"line"];
        [self.screenPicture addSubview:lineImageView];
        
        _typeTimeLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, SCREEN_HEIGHT/2+55, SCREEN_WIDTH, 20)];
        _typeTimeLabel.font = [UIFont systemFontOfSize:13];
        _typeTimeLabel.textColor = [UIColor whiteColor];
        [self.screenPicture addSubview:_typeTimeLabel];
        
        _descLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, SCREEN_HEIGHT/2+80, SCREEN_WIDTH-20, 80)];
        _descLabel.font = [UIFont systemFontOfSize:13];
        _descLabel.numberOfLines = 4;
        [self.screenPicture addSubview:_descLabel];
        
        _likeButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _likeButton.frame = CGRectMake(10, SCREEN_HEIGHT-120, 20, 20);
        [_likeButton setImage:[UIImage imageNamed:@"heart"] forState:UIControlStateNormal];
        [_likeButton setImage:[UIImage imageNamed:@"whiteHeart"] forState:UIControlStateSelected];
        [self.screenPicture addSubview:_likeButton];
        
        _likeNumLabel = [[UILabel alloc]initWithFrame:CGRectMake(35, SCREEN_HEIGHT-120, 60, 20)];
        _likeNumLabel.textColor = [UIColor whiteColor];
        _likeNumLabel.font = [UIFont systemFontOfSize:13];
        [self.screenPicture addSubview:_likeNumLabel];
        
        _shareButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _shareButton.frame = CGRectMake(100, SCREEN_HEIGHT-120, 20, 20);
        [_shareButton setImage:[UIImage imageNamed:@"share"] forState:UIControlStateNormal];
        [self.screenPicture addSubview:_shareButton];
        
        _shareNumLabel = [[UILabel alloc]initWithFrame:CGRectMake(125, SCREEN_HEIGHT-120, 60, 20)];
        _shareNumLabel.textColor = [UIColor whiteColor];
        _shareNumLabel.font = [UIFont systemFontOfSize:13];
        [self.screenPicture addSubview:_shareNumLabel];
        
        _downloadButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _downloadButton.frame = CGRectMake(190, SCREEN_HEIGHT-120, 20, 20);
        [_downloadButton setImage:[UIImage imageNamed:@"download"] forState:UIControlStateNormal];
        [self.screenPicture addSubview:_downloadButton];
        
        UILabel *cacheLabel = [[UILabel alloc]initWithFrame:CGRectMake(215, SCREEN_HEIGHT-120, 50, 20)];
        cacheLabel.text = @"缓存";
        cacheLabel.textColor = [UIColor whiteColor];
        cacheLabel.font = [UIFont systemFontOfSize:13];
        [self addSubview:cacheLabel];
    }
    return self;
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
